package com.fdd.op.sdk.request.api.contract;

import com.fdd.op.sdk.ApiRuleException;
import com.fdd.op.sdk.BaseFddRequest;
import com.fdd.op.sdk.constants.Constants;
import com.fdd.op.sdk.internal.mapping.RequestField;
import com.fdd.op.sdk.internal.util.StringUtils;
import com.fdd.op.sdk.response.api.contract.AbolishResponse;

import java.util.Map;

public class AbolishRequest extends BaseFddRequest<AbolishResponse> {
    @Override
    public String getApiMethodName() {
        return "/base/api/contract/abolish";
    }

    @Override
    public Map<String, Object> getTextParams() {
        return null;
    }

    @Override
    public Class<AbolishResponse> getResponseClass() {
        return AbolishResponse.class;
    }

    @Override
    public void check() throws ApiRuleException {
        if(StringUtils.isBlank(getDocId()) && StringUtils.isBlank(getTpDocId())){
            throw new ApiRuleException("33030", "文档在在电子签系统的docId与在客户业务系统的tpDocId不允许同时为空！");
        }
    }

    @Override
    public String getHttpMethod() {
        return Constants.METHOD_POST;
    }

    @RequestField
    private String docId;

    @RequestField
    private String tpDocId;

    @RequestField
    private String fileId;

    @RequestField
    private String reason;

    @RequestField
    private String accountId;

    @RequestField
    private String tpAccountId;

    @RequestField
    private Integer urlTimeOut;

    @RequestField
    private Integer accessType;

    @RequestField
    private Integer clientPageType;

    public String getDocId() {
        return docId;
    }

    public void setDocId(String docId) {
        this.docId = docId;
    }

    public String getTpDocId() {
        return tpDocId;
    }

    public void setTpDocId(String tpDocId) {
        this.tpDocId = tpDocId;
    }

    public String getFileId() {
        return fileId;
    }

    public void setFileId(String fileId) {
        this.fileId = fileId;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public String getAccountId() {
        return accountId;
    }

    public void setAccountId(String accountId) {
        this.accountId = accountId;
    }

    public String getTpAccountId() {
        return tpAccountId;
    }

    public void setTpAccountId(String tpAccountId) {
        this.tpAccountId = tpAccountId;
    }

    public Integer getUrlTimeOut() {
        return urlTimeOut;
    }

    public void setUrlTimeOut(Integer urlTimeOut) {
        this.urlTimeOut = urlTimeOut;
    }

    public Integer getAccessType() {
        return accessType;
    }

    public void setAccessType(Integer accessType) {
        this.accessType = accessType;
    }

    public Integer getClientPageType() {
        return clientPageType;
    }

    public void setClientPageType(Integer clientPageType) {
        this.clientPageType = clientPageType;
    }
}
